import { defHttp, request } from '/@/utils/http/axios';

enum Api {
  Login = '/login',
  GetUserInfo = '/getInfo',
  EditInfo = '/editInfo',
}

/**
 * post请示例
 * @param params
 * @returns
 */
export const login = (params: any) => defHttp.post({ url: Api.Login, params });

/**
 * get请求示例
 * @param id
 * @returns
 */
export const getUserInfo = (id: string) => defHttp.get({ url: Api.GetUserInfo, params: { id } });

/**
 * 综合请求 - ylhkj熟悉的感觉
 * @param data
 * @returns
 */
export const editInfo = (data: any) => {
  return request({
    url: Api.EditInfo,
    method: 'POST',
    data,
  });
};
